package com.oocl.crm.service.impl;

import com.oocl.crm.command.Command;
import com.oocl.crm.command.impl.HelpCommand;
import com.oocl.crm.exception.ParameterErrorException;
import com.oocl.crm.service.BusinessService;
import com.oocl.crm.util.StringUtil;

/**
 * 帮助说明业务处理
 * @author GANAB
 *
 */
public class HelpBusinessService extends BusinessService{

	public String service(Command command) throws ParameterErrorException {
		String result = "";
		HelpCommand helpCommand = (HelpCommand) command;
		if(helpCommand.getParams()!=null){
			switch (command.getParams().charAt(0)) {
			case 'A':
				result = StringUtil.addHelpDoc;
				break;
			case 'D':
				result = StringUtil.deleteHelpDoc;
				break;
			case 'U':
				result = StringUtil.updateHelpDoc;
				break;
			case 'L':
				result = StringUtil.lookupHelpDoc;
				break;
			case 'O':
				result = StringUtil.orderHelpDoc;
				break;
			case 'H':
				result = StringUtil.helpHelpDoc;
				break;
			case 'Q':
				result = StringUtil.quitHelpDoc;
				break;
			default:
				result = StringUtil.helpDoc();
				break;
			}
		}
		return result;
	}
	
	
}
